package com.arkisv.common.model;

import java.io.Serializable;

import com.arkisv.log.util.Global;

public class EventLog implements Serializable {
    private String eventId;

    private Integer appId;

    private Long methodId;

    private Byte status;

    private Long createTime = Global.getDayBeginTime();

    private Long endTime;

    private boolean isAdd; // true:添加操作  false:修改操作

    private ParamLog paramLog; // 参数对象

    private Long cacheTime; // 如果更新前,数据不存在,则先将该记录缓存(记录缓存时间)

    private static final long serialVersionUID = 1L;

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId == null ? null : eventId.trim();
    }

    public Integer getAppId() {
        return appId;
    }

    public void setAppId(Integer appId) {
        this.appId = appId;
    }

    public Long getMethodId() {
        return methodId;
    }

    public void setMethodId(Long methodId) {
        this.methodId = methodId;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public ParamLog getParamLog() {
        return paramLog;
    }

    public void setParamLog(ParamLog paramLog) {
        this.paramLog = paramLog;
    }

    public boolean isAdd() {
        return isAdd;
    }

    public void setAdd(boolean add) {
        isAdd = add;
    }

    public Long getCacheTime() {
        return cacheTime;
    }

    public void setCacheTime(Long cacheTime) {
        this.cacheTime = cacheTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EventLog other = (EventLog) that;
        return (this.getEventId() == null ? other.getEventId() == null : this.getEventId().equals(other.getEventId()))
            && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
            && (this.getMethodId() == null ? other.getMethodId() == null : this.getMethodId().equals(other.getMethodId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEventId() == null) ? 0 : getEventId().hashCode());
        result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
        result = prime * result + ((getMethodId() == null) ? 0 : getMethodId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        return result;
    }

	@Override
	public String toString() {
		return "EventLog [eventId=" + eventId + ", appId=" + appId + ", methodId=" + methodId + ", status=" + status
				+ ", createTime=" + createTime + ", endTime=" + endTime + ", isAdd=" + isAdd + ", paramLog=" + paramLog
				+ ", cacheTime=" + cacheTime + "]";
	}

}